{% extends 'base.html' %}

{% block title %}
    {{ post.title }}
{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-lg-9">
            <div class="row">
                <div class="col-lg-12">
                    <h2>{{ post.title }}</h2>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <h7>发布日期: {{ post.publish_date }}</h7>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <h4>{{ post.text }}</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-12">
        <h3>New Comment:</h3>
        <form method="POST" action="{{ url_for('blog.post', post_id=post.id) }}">
            {{ form.hidden_tag() }}
            <div class="form-group">
                {{ form.name.label }}
                {% if form.name.errors %}
                    {% for e in form.name.errors %}
                        <p class="help-block">{{ e }}</p>
                    {% endfor %}
                {% endif %}
                {{ form.name(class_='form_control') }}
            </div>
            <div class="form-group">
                {{ form.text.label }}
                {% if form.text.errors %}
                    {% for e in form.text.errors %}
                        <p class="help-block">{{ e }}</p>
                    {% endfor %}
                {% endif %}
                {{ form.text(class_='form_control') }}
            </div>
            <input class="btn btn-primary" type="submit" value="Add Comment">
        </form>
    </div>
{% endblock %}